﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Database;

namespace Model.Mapping
{
    public class TestMap : EntityTypeConfiguration<Test>
    {
        public TestMap()
        {
            // Primary Key
            this.HasKey(t => t.TestId);

            // Properties
            this.Property(t => t.TestId)
                .IsRequired()
                .HasMaxLength(32);

            this.Property(t => t.Name)
                .HasMaxLength(25);

            this.Property(t => t.Value)
                .HasMaxLength(25);

            this.Property(t => t.Description)
               .HasMaxLength(100);

            this.Property(t => t.TempOne)
              .HasMaxLength(50);

            this.Property(t => t.TempTwo)
             .HasMaxLength(50);

            this.Property(t => t.TempThree)
             .HasMaxLength(50);

            this.Property(t => t.TempFour)
             .HasMaxLength(50);

            this.Property(t => t.TempFive)
             .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Test");
            this.Property(t => t.TestId).HasColumnName("TestId");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Value).HasColumnName("Value");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.TempOne).HasColumnName("TempOne");
            this.Property(t => t.TempTwo).HasColumnName("TempTwo");
            this.Property(t => t.TempThree).HasColumnName("TempThree");
            this.Property(t => t.TempFour).HasColumnName("TempFour");
            this.Property(t => t.TempFive).HasColumnName("TempFive");
            this.Property(t => t.AddTime).HasColumnName("AddTime");
            this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
        }
    }
}
